const app = getApp()
import { setStorage, getStorage } from "../../utils/localStorage"
// console.log(app.globalData.bottomLift)
Page({
    data: {
        footerIndex: 1,
        date: {},
        pageTop: app.globalData.navHeight + app.globalData.navTop,
        pageBottom: app.globalData.bottomLift - 12,
        townPage: null,
        luxianNavIndex:0,
    },
    onLoad(options) {
        if (JSON.stringify(options) != "{}") {
            this.setData({
                footerIndex: Number(options.index)
            })
        };
    },
    onShow() {
    },
    onReady() {

    },
    //子组件触发父组件的方法
    tabFooter(e) {
        const index = e.detail;
        this.setData({
            footerIndex: index
        });
    },

    //底部切换栏事件
    footerNav(e) {
        let index = e.detail;
        this.setData({
            footerIndex: index,
        });
        setStorage('pageIndex', this.data.footerIndex);
    },
    //分享页面给朋友
    onShareAppMessage() {
        let that = this;
        return {
            title: '美丽乡音微信小程序',
            desc: '好看的哦',
            path: '/pages/index/index', // 路径，传递参数到指定页面。
        }
    },
    //分享页面到朋友圈
    onShareTimeline: function () {
        return {
            title: '美丽乡音微信小程序',
            imageUrl: '../../image/wxy.jpg'
        }
    },

    /**
     * 生命周期函数--监听页面下拉刷新
     */

    onRefresh: function () {
        console.log(12312);
    }


})